package com.cgwx.common.config;


//import com.cgwx.service.impl.StatisticalTaskInfoServiceImpl;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;


@Configuration
@Slf4j
public class ScheduledTaskConfig {

    /**
     * 日志
     */

    @Bean
    public ThreadPoolTaskScheduler threadPoolTaskScheduler() {
//        LOGGER.info("创建定时任务调度线程池 start");
        ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
        threadPoolTaskScheduler.setPoolSize(20);
        threadPoolTaskScheduler.setThreadNamePrefix("taskExecutor-");
        threadPoolTaskScheduler.setWaitForTasksToCompleteOnShutdown(true);
        threadPoolTaskScheduler.setAwaitTerminationSeconds(60);
//        LOGGER.info("创建定时任务调度线程池 end");
        return threadPoolTaskScheduler;
    }
}

    /**
     * 初始化定时任务Map
     * key :任务key
     * value : 执行接口实现
     */
   /* @Bean(name = "scheduledTaskJobMap")
    public Map<String, StatisticalTaskInfo> scheduledTaskJobMap() {
        ret

    */